package com.itcast.springboot;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloSpringBoot {
    @Value("${name}")
    private String name;
    @Value("${person.name}")
    private String name2;
    @Value("${person.age}")
    private String age;
    @Value("${address[0]}")
    private String address;
    @Value("${mag}")
    private String mag;

    @RequestMapping("/hello")
    public String hello(){
        return "success!";
    }

    @RequestMapping("/hello2")
    public void hello2(){
        System.out.println(name);
        System.out.println(name2);
        System.out.println(address);
        System.out.println(mag);
    }
}
